package cvo.chess.tests.pieces;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.util.List;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import cvo.chess.client.entities.IGameFacade;
import cvo.chess.client.entities.armies.pieces.Pawn;
import cvo.chess.client.entities.chessboard.ChessboardCoordinate;
import cvo.chess.client.entities.game.Army;
import cvo.chess.client.entities.game.Chessboard;
import cvo.chess.client.entities.game.IPiece;

public class PawnTestPossibleMoves {
	
	private IGameFacade gf;
	private Chessboard board;
	private Army armyWhite;
	
	@Before
	public void setUp(){
		gf = mock(IGameFacade.class);		
		armyWhite = mock(Army.class);
		when(armyWhite.getColor()).thenReturn("white");
		board = mock(Chessboard.class);
		when(board.getHeight()).thenReturn(8);
		when(board.getWidth()).thenReturn(8);
	}
	
	@Test
	public void testWhenPawnOnD3() throws Exception {
		IPiece pawn = new Pawn(gf, armyWhite);
		gf.setPieceAtPosition(pawn, "D3");
		when(gf.getPieceAt("D3")).thenReturn(pawn);
		
		Assert.assertNotNull("List of possible moves may not be null", pawn.getPossibleMoves());
		Assert.assertFalse("List must contain more possible moves", pawn.getPossibleMoves().isEmpty());
		
		List <ChessboardCoordinate> list = pawn.getPossibleMoves();
		

	}

}